<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>打印合同</title>
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/print.css">
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
	</head>

	<body>
		<div class="class=" div_print_info_portait "">
			<h1 align="center">绵阳市高水农副产品批发有限公司</h1>
			<h1 align="center">短期合同信息</h1>
			<form id="ff" method="post">
				<div id="p" title="基本信息" style="width:100%;padding:10px;">
					<table cellpadding="5" class="altrowstable printtable">
						<tr>
							<td width="10%" style="display: none;">合同ID</td>
							<td width="23%" style="display: none;">
								<input style="width:100%" class="print_text_style" type="text" name="TENANT_ID"></input>
							</td>
							<td width="10%">合同编号</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" name="ORDER_NO"></input>
							</td>
							<td width="10%">客户名称</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" type="text" name="TENANT_NAME"></input>
							</td>
							<td width="10%">合同类型</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" type="text" name="CONTRACT_TYPE"></input>
							</td>
						</tr>
						<tr>
							<!--<td width="10%">合同期限</td>
							<td width="23%">
								<input style="width:100%" class="easyui-textbox" type="contract_term" id="input_DEADLINE" name="DEADLINE" data-options="required:true"></input>
							</td>-->
							<td width="10%">开始时间</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" name="BEGIN_TIME"></input>
							</td>
							<td width="10%">结束时间</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" name="END_TIME"></input>
							</td>
						</tr>
						<tr>
							<td width="10%">租金总额</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" name="RENT_SUM" prefix="￥"></input>
							</td>
							<td width="10%">保证金总额</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" type="text" name="MARGIN_SUM" prefix="￥"></input>
							</td>
							<td width="10%">其他费用合计</td>
							<td width="23%">
								<input style="width:100%" class="print_text_style" type="text" name="OTHERS_SUM" prefix="￥"></input>
							</td>
						</tr>
					</table>
					<table id="OrderInforTable" class="altrowstable printtable" style="margin-top: 0px;">
						<tr>
							<th colspan="12" align="left">
								<div>短期合同摊位明细</div>
							</th>
						</tr>
						<tr>
							<th>
								<div name="SHORT_NAME">短期合同名称</div>
							</th>
							<th>
								<div name="RENT">租金</div>
							</th>
							<th>
								<div name="MARGIN">保证金</div>
							</th>
							<th>
								<div name="OTHERS_CHARGE">其他费用</div>
							</th>
							<th>
								<div name="BEGIN_TIME">合同开始时间</div>
							</th>
							<th>
								<div name="END_TIME">合同结束时间</div>
							</th>
							<th>
								<div name="RENT_END">实际租用结束时间</div>
							</th>
							<th>
								<div name="SUM">小计</div>
							</th>
							<th>
								<div name="STATE">摊位状态</div>
							</th>
						</tr>
					</table>
					<table id="OrderChargeTable" class="altrowstable printtable" style="margin-top: 0px;">
						<tr>
							<th colspan="4" align="left">
								<div>长期合同费用明细</div>
							</th>
						</tr>
						<tr>
							<th>
								<div name="CHARGENAME">费用名称</div>
							</th>
							<th>
								<div name="CHARGETYPE">费用类型</div>
							</th>
							<th>
								<div name="EVIDENCE_ID">交易凭证号</div>
							</th>
							<th>
								<div name="SUM">金额</div>
							</th>
						</tr>
					</table>
				</div>
			</form>
		</div>
	</body>
	<script type="text/javascript">
		var id = getID();
		$(document).ready(function(){
		loadRemote();
		});
		function loadRemote() {
			$('#ff').form('load', RemoteLinkAddress + '/market/contract/findbyid.do?ID=' + id);
			$.ajax({
				type: "get",
				url: RemoteLinkAddress + '/market/contract/findbyid.do?ID=' + id,
				dataType: "json",
				success: function(result) {
					var newTd = new Array();
					var _data = result.rowsShort;
					for(var i = 0; i < _data.length; i++) {
						var newTr = OrderInforTable.insertRow();
						newTd[0] = newTr.insertCell()
						if(_data[i].SHORT_NAME != undefined)
							newTd[0].innerText = _data[i].SHORT_NAME;

						newTd[4] = newTr.insertCell();
						if(_data[i].RENT != undefined)
							newTd[4].innerText = _data[i].RENT;

						newTd[5] = newTr.insertCell();
						if(_data[i].MARGIN != undefined)
							newTd[5].innerText = _data[i].MARGIN;

						newTd[5] = newTr.insertCell();
						if(_data[i].OTHERS_CHARGE != undefined)
							newTd[5].innerText = _data[i].OTHERS_CHARGE;

						newTd[5] = newTr.insertCell();
						if(_data[i].BEGIN_TIME != undefined)
							newTd[5].innerText = _data[i].BEGIN_TIME;

						newTd[5] = newTr.insertCell();
						if(_data[i].END_TIME != undefined)
							newTd[5].innerText = _data[i].END_TIME;

						newTd[5] = newTr.insertCell();
						if(_data[i].RENT_END != undefined)
							newTd[5].innerText = _data[i].RENT_END;

						newTd[5] = newTr.insertCell();
						if(_data[i].SUM != undefined)
							newTd[5].innerText = _data[i].SUM;

						newTd[5] = newTr.insertCell();
						if(_data[i].STATE != undefined)
							newTd[5].innerText = _data[i].STATE;
					}
					var _data = result.rowsCharge;
					for(var i = 0; i < _data.length; i++) {
						var newTr = OrderChargeTable.insertRow();
						newTd[0] = newTr.insertCell()
						if(_data[i].CHARGENAME != undefined)
							newTd[0].innerText = _data[i].CHARGENAME;

						newTd[1] = newTr.insertCell();
						if(_data[i].CHARGETYPE != undefined)
							newTd[1].innerText = _data[i].CHARGETYPE;

						newTd[2] = newTr.insertCell();
						if(_data[i].EVIDENCE_ID != undefined)
							newTd[2].innerText = _data[i].EVIDENCE_ID;

						newTd[3] = newTr.insertCell();
						if(_data[i].SUM != undefined)
							newTd[3].innerText = _data[i].SUM;
					}
					$("#sumxx").val(result.LUMP_SUM);
//					$("#sumdx").val(changeMoneyToChinese(result.LUMP_SUM));
				}
			});
		}
	</script>

</html>